|
Расположение в меню |
---|
Modification → Смещение |
Верстаки |
Draft, Arch |
Быстрые клавиши |
O S |
Представлено в версии |
- |
См. также |
2D смещение... |
The Draft Offset command offsets each segment of a selected object over a given distance, or creates an offset copy of the selected object.
Offsetting a Draft Wire
See also: Draft Snap and Draft Constrain.
The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 1.0).
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To offset objects use the offset
method of the Draft module. The method can only handle Draft Wires, Draft Circles, Draft Rectangles, Draft Polygons and Draft BSplines.
offset_obj = offset(obj, delta, copy=False, bind=False, sym=False, occ=False)
obj
is the object to be offset.delta
contains the offset information:
copy
is True
the original object is kept and a new object is created.bind
is True
a face is created by connecting the shape of the original object and the shape of its offset. This only works for open Draft Wires.sym
is True
, and bind
is True
as well, the offset is made on both sides of the original object, the total width being the length of the given vector. This only works for open Draft Wires.occ
is True
OCC-style offsetting is used. See Options. If occ
is True
the bind
and sym
arguments are ignored.offset_obj
is returned with the original offset object, or with the new object. If bind
is True
or occ
is True
, the new object is a Part::Feature
object.Пример:
import FreeCAD as App
import Draft
doc = App.newDocument()
p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1500, 2000, 0)
p3 = App.Vector(4000, 0, 0)
wire = Draft.make_wire([p1, p2, p3])
doc.recompute()
vector = App.Vector(-200, 150, 0)
offset1 = Draft.offset(wire, vector, copy=True, bind=True, sym=True)
offset2 = Draft.offset(wire, 3*vector, copy=True)
offset3 = Draft.offset(wire, 6*vector, copy=True)
offset4 = Draft.offset(wire, 9*vector, copy=True)
offset5 = Draft.offset(wire, 1.5*vector, copy=True, occ=True)
doc.recompute()